#ifndef _ROBOMOVE_H_
#define _ROBOMOVE_H_

/**
 * robostraight for moving straight with assigned velocity (can be negative) 
 * no pause in this function using only the shaft encoders on the wheel
 * @requires none
 * @effects robot walks in the straight line with (hopefully) desired velocity 
 * @modifies none
 */
void roboStraight(int16_t robovel);
void motorSetVel(uint8_t motor, int16_t vel);
/**
 * robostop simply stops both motors from spinning
 * @requires none
 * @effects both motors brake and stop
 * @modifies none
 */
void roboStop(void);

/**
 * lineFollowFeedback provides the feedback for the robot to speed up or slow down the left
 * wheel so that the robot follows the line that is drawn under it
 * 
 * The value returned will be negative if the robot needs to move more to the left (slow down
 * the left wheel) and will be positive if the robot needs to move more to the right (speed up
 * the left wheel). The returned value of 0 means that the robot should continue the 
 * provided speed.
 *
 * The more the returned value, the more speed adjustment is required
 *
 * @requires 
 * @effects the feedback of turning slightly left or right are returned
 * @modifies none
 */
int8_t lineFollowFeedback(void);
 
/**
 * lineFollow runs a routine of directing the robot along the given black line.
 * if no black line is found, the robot will continue to go forward until it
 * finds one
 *
 * @requires none
 * @effects the robot moves straight along the black line
 * @modifies none
 */
void lineFollow(int16_t robovel);

/**
 * wallFollowFeedback will give a wall following feedback based on the given bumper (signified
 * by the boolean whether it is the left or the right one from robot's perspective). This is
 * assumed that the robot has already found the wall it has to follow.
 *
 * The value returned will be 0 if the robot has to move towards the wall and 1 if the
 * robot has to move away from the wall
 * @requires valid digital port of interest
			robot has found wall to follow
 * @effects returns 0 if the digital bumper is released and returns 1 if the digital
 * 			bumper is pressed down
 * @modifies none
 */
uint8_t wallFollowFeedback(bool followLeft);

/**
 * WallFollow directs the robot to follow the wall (given to be left or right side)
 *
 * In details, the robot steers out of the wall when the feedback shows that the sensor
 * is touching the wall. On the other hand, it steers into the wall when the feedback
 * shows that the sensor is not touching the wall.
 * 
 * @requires the given velocity is below the max speed of the robot
 * @effects the robot follows the wall of the given side
 * @modifies none
 */
void wallFollow(bool followLeft, int16_t robovel);

/**
 * "backTilBump" moves the robot backward until it bumps against the wall and continue the attempt
 * to move back for several seconds more. Then, the robot stops.
 *
 * @requires none
 * @effects robot moves backward until it bumps with wall
 * @modifies none
 */
void backTilBump(void);

#endif



